home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW Related / DTS MPW Goodies / StripUnits < prev    next >
Encoding:
Text File  |  1990-09-14  |  830 b   |  48 lines  |  [TEXT/MPS ]

  1. #    StripUnits - Remove the ckid resource from a list of files.
  2. #
  3. #    Usage:    StripUnits files…
  4. #
  5. #    StripUnits removes the unit resource (if it exists) from a
  6. #    list of files. 
  7. #
  8. #    © Apple Computer, Inc. 1988
  9. #    All rights reserved.
  10.  
  11. Set Exit 0
  12.     
  13. #    Check the parameters
  14.  
  15. If {#} == 0
  16.     Echo "### Usage - {0} files…" > dev:stderr
  17.     Exit 1
  18. End
  19.  
  20.     
  21. For name in {"parameters"}
  22.     Begin
  23.         If "`Exists -f "{name}"`" != ""
  24.             Set path `Files -f "{name}"`
  25.             Set wind 0
  26.             For i in `Windows`
  27.                 If "{path}" == "{i}"
  28.                     Set wind 1
  29.                     Break
  30.                 End
  31.             End
  32.             Echo "Delete 'unit';" | Rez -a -o "{name}"
  33.             If {wind}
  34.                 If "{path}" == "{active}"
  35.                     Close "{name}"
  36.                     Open "{name}"
  37.                 Else
  38.                     Close "{name}"
  39.                     Target "{name}"
  40.                 End
  41.             End
  42.         Else
  43.             Echo "### {0}" - File "'{name}'" does not exist. > dev:stderr
  44.             Exit 2
  45.         End
  46.     End
  47. End 
  48.